<div id="addMachineModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">添加设备门禁</h3>
                <div class="ibox-content">
                    <div>
                        <div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">设备编码</label>
                                <div class="col-sm-10">
                                    <input v-model="addMachineInfo.machineCode" type="text" placeholder="必填，请填写设备编码"
                                        class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">版本号</label>
                                <div class="col-sm-10">
                                    <input v-model="addMachineInfo.machineVersion" type="text" placeholder="必填，请填写版本号"
                                        class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">设备名称</label>
                                <div class="col-sm-10">
                                    <input v-model="addMachineInfo.machineName" type="text" placeholder="必填，请填写设备名称"
                                        class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">设备类型</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addMachineInfo.machineTypeCd">
                                        <option selected disabled value="">必填，请选择设备类型</option>
                                        <option value="9999">门禁</option>
                                        <option value="9996">车辆道闸</option>
                                        <option value="9997">考勤机</option>
                                        <option value="9995">第三方道闸平台</option>
                                    </select></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">设备方向</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addMachineInfo.direction">
                                        <option selected disabled value="">必填，请选择设备方向</option>
                                        <option value="3306">进场</option>
                                        <option value="3307">出场</option>
                                    </select></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">厂家</label>
                                <div class="col-sm-10">
                                    <input v-model="addMachineInfo.authCode" type="text" placeholder="必填，请填写厂家"
                                        class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">设备位置</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addMachineInfo.locationTypeCd"
                                        @change="onAddChangeLocation">
                                        <option selected disabled value="">必填，请选择设备位置</option>
                                        <option v-for="item in addMachineInfo.locations" :label="item.locationName"
                                            :value="item.locationId">{{item.locationName}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row"
                            v-show="addMachineInfo.locationType == '2000' || addMachineInfo.locationType == '3000'  ">
                            <label class="col-sm-2 col-form-label">归属楼栋</label>
                            <div class="col-sm-10">
                                <vc:create path="property/floorSelect2" parentModal="addMachineModel"
                                    namespace="addMachine"></vc:create>
                            </div>
                        </div>
                        <div class="form-group row"
                            v-show="addMachineInfo.locationType == '2000' || addMachineInfo.locationType == '3000'  ">
                            <label class="col-sm-2 col-form-label">归属单元</label>
                            <div class="col-sm-10">
                                <vc:create path="property/unitSelect2" parentModal="addMachineModel"
                                    callBackListener="addMachine" callBackFunction="notify" namespace="addMachine">
                                </vc:create>
                            </div>
                        </div>
                        <div class="form-group row" v-show="addMachineInfo.locationType == '3000'  ">
                            <label class="col-sm-2 col-form-label">归属房屋</label>
                            <div class="col-sm-10">
                                <vc:create path="property/roomSelect2" parentModal="addMachineModel"
                                    callBackListener="addMachine" callBackFunction="notify" namespace="addMachine">
                                </vc:create>
                            </div>
                        </div>
                        <div class="form-group row" v-show="addMachineInfo.locationType == '4000'  ">
                            <label class="col-sm-2 col-form-label">归属停车场</label>
                            <div class="col-sm-10">
                                <vc:create path="property/parkingAreaSelect2" parentModal="addMachineModel"
                                    callBackListener="addMachine" callBackFunction="notify" namespace="addMachine">
                                </vc:create>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">设备IP</label>
                            <div class="col-sm-10">
                                <input v-model="addMachineInfo.machineIp" type="text" placeholder="选填，请填写设备IP,如 192.168.1.10:8090"
                                    class="form-control">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">设备MAC</label>
                            <div class="col-sm-10">
                                <input v-model="addMachineInfo.machineMac" type="text" placeholder="选填，请填写设备MAC"
                                    class="form-control">
                            </div>
                        </div>

                        <div v-for="(item,index) in addMachineInfo.attrs">

                            <div class="form-group row" v-if="item.specType == '2233'">
                                <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                <div class="col-sm-10">
                                    <input v-model="item.value" type="text" :placeholder="item.specHoldplace"
                                        class="form-control">
                                </div>
                            </div>
                            <div class="form-group row" v-if="item.specType == '3344'">
                                <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="item.value">
                                        <option selected disabled value="">{{item.specHoldplace}}</option>
                                        <option v-for="value in item.values" :label="value.valueName"
                                            :value="value.value">
                                            {{item.valueName}}
                                        </option>
                                    </select>
                                </div>
                            </div>

                        </div>

                        <div class="ibox-content">
                            <button class="btn btn-primary float-right" type="button" v-on:click="saveMachineInfo()"><i
                                    class="fa fa-check"></i>&nbsp;保存
                            </button>
                            <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                data-dismiss="modal">取消
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>